package com.just.springmvc4.controller;

import com.just.springmvc4.domain.DemoObj;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class AdviceController {
    @RequestMapping("/advice")
    public String getSomething(@ModelAttribute("msg") String msg, DemoObj demoObj){
        System.out.println("收到的msg:"+msg);
        System.out.println("demoObj:"+demoObj.toString());
        throw new IllegalArgumentException("非常抱歉，参数有误，来自@ModelAttribute:"+msg);
    }
}
